<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>纯CSS实现轮播图(自动轮播)</title>
    <style>
        .div1 {
            width: 400px;
            height: 300px;
            margin: 0 auto;
            background-color: aqua;
            overflow: hidden;
        }

        .div2 {
            display: flex;
            width: 1600px;
            height: 300px;
            background-color: aquamarine;
            overflow: hidden;
            animation: run 10s infinite;
        }

        .div2 img {
            width: 400px;
            height: 300px;
            vertical-align: middle;
            object-fit: cover;
        }

        @keyframes run {

            0% {
                transform: translateX(0);
            }

            33% {
                transform: translateX(-400px);
            }

            66% {
                transform: translateX(-800px);
            }

            100% {
                transform: translateX(-1200px);
            }
        }

        .div3 {
            margin: 20px auto;
            width: 200px;
            height: 200px;
            display: flex;
            background-image: radial-gradient(100px at 100px 100px, rgb(255, 0, 0), blue);
            z-index: 1;
            justify-content: center;
            align-items: center;
        }

        .div3:hover {
            /*径向渐变*/
            border-radius: 50%;
            background-image: radial-gradient(200px at 100px 100px, rgb(255, 0, 0), blue, yellow, pink, green, rgb(0, 255, 136));
        }

        .div4 {
            width: 200px;
            height: 400px;
            margin: 0 auto;
            background-image: linear-gradient(0deg, red, blue);
            /*线性渐变*/
            animation: move 2s infinite;

        }

        @keyframes move {

            0%,
            90% {
                background-image: linear-gradient(0deg, red, blue);
            }

            30% {
                background-image: linear-gradient(30deg, red, blue);
            }

            60% {
                background-image: linear-gradient(60deg, red, blue);
            }

            90% {
                background-image: linear-gradient(90deg, red, blue);
            }

            120% {
                background-image: linear-gradient(120deg, red, blue);
            }

            150% {
                background-image: linear-gradient(150deg, red, blue);
            }

            180% {
                background-image: linear-gradient(180deg, red, blue);
            }


        }
    </style>

</head>

<body>
    <!-- 创建外部展示容器 -->
    <div class="div1">
        <!-- 创建图片存储容器 -->
        <div class="div2">
            <img src="./image/vue.png" alt="">
            <img src="./image/vue2.png" alt="">
            <img src="./image/vue3.png" alt="">
            <img src="./image/vue.png" alt="">
        </div>
    </div>
    <div class="div3">
        <div></div>
    </div>
    <div class="div4"></div>
</body>

</html>